{% load math %}
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>MPR (Medicine Price Registry) - OpenUp</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="google-site-verification" content="_lWgnvin7w-6I_YOY23q3dI9E0pFAD8N6kQRPQda63g" />
    {% load pipeline %}
    {% stylesheet 'mpr' %}

    <script type="text/javascript">
    window.analytics||(window.analytics=[]),window.analytics.methods=["identify","track","trackLink","trackForm","trackClick","trackSubmit","page","pageview","ab","alias","ready","group","on","once","off"],window.analytics.factory=function(a){return function(){var t=Array.prototype.slice.call(arguments);return t.unshift(a),window.analytics.push(t),window.analytics}};for(var i=0;i<window.analytics.methods.length;i++){var method=window.analytics.methods[i];window.analytics[method]=window.analytics.factory(method)}window.analytics.load=function(a){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src=("https:"===document.location.protocol?"https://":"http://")+"d2dq2ahtl5zl1z.cloudfront.net/analytics.js/v1/"+a+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n)},window.analytics.SNIPPET_VERSION="2.0.6",
    window.analytics.load("4645xq3bi2"),
    window.analytics.page();
    </script>

    <script type="text/javascript">
        (function(e,t){var n=e.amplitude||{_q:[],_iq:{}};var r=t.createElement("script")
        ;r.type="text/javascript";r.async=true
        ;r.src="https://cdn.amplitude.com/libs/amplitude-4.4.0-min.gz.js"
        ;r.onload=function(){if(e.amplitude.runQueuedFunctions){
        e.amplitude.runQueuedFunctions()}else{
        console.log("[Amplitude] Error: could not load SDK")}}
        ;var i=t.getElementsByTagName("script")[0];i.parentNode.insertBefore(r,i)
        ;function s(e,t){e.prototype[t]=function(){
        this._q.push([t].concat(Array.prototype.slice.call(arguments,0)));return this}}
        var o=function(){this._q=[];return this}
        ;var a=["add","append","clearAll","prepend","set","setOnce","unset"]
        ;for(var u=0;u<a.length;u++){s(o,a[u])}n.Identify=o;var c=function(){this._q=[]
        ;return this}
        ;var l=["setProductId","setQuantity","setPrice","setRevenueType","setEventProperties"]
        ;for(var p=0;p<l.length;p++){s(c,l[p])}n.Revenue=c
        ;var d=["init","logEvent","logRevenue","setUserId","setUserProperties","setOptOut","setVersionName","setDomain","setDeviceId","setGlobalUserProperties","identify","clearUserProperties","setGroup","logRevenueV2","regenerateDeviceId","logEventWithTimestamp","logEventWithGroups","setSessionId","resetSessionId"]
        ;function v(e){function t(t){e[t]=function(){
        e._q.push([t].concat(Array.prototype.slice.call(arguments,0)))}}
        for(var n=0;n<d.length;n++){t(d[n])}}v(n);n.getInstance=function(e){
        e=(!e||e.length===0?"$default_instance":e).toLowerCase()
        ;if(!n._iq.hasOwnProperty(e)){n._iq[e]={_q:[]};v(n._iq[e])}return n._iq[e]}
        ;e.amplitude=n})(window,document);

        amplitude.getInstance().init("ed38686b8df8e62757816e2113fce0b5");
    </script>

    <!-- Hotjar Tracking Code for http://mpr.code4sa.org -->
    <script>
        (function(h,o,t,j,a,r){
            h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
            h._hjSettings={hjid:1129065,hjsv:6};
            a=o.getElementsByTagName('head')[0];
            r=o.createElement('script');r.async=1;
            r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
            a.appendChild(r);
        })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
    </script>

  </head>
  <body>
    <a id="top"></a>
    <main class="container">
      <header role="banner" class="container page-header">
        <h1>What should your medicines cost?</h1>
      </header>
      <article role="main" class="col-md-12">
      {% block body %}{% endblock %}
      </article>
      <aside class="col-md-12">
        <section class="panel panel-info">
          <header class="panel-heading">
            <h3 class="panel-title">What is this all about?</h3>
          </header>
          <div class="panel-body">
            <p>Did you know that medicine prices are regulated in South Africa? Using this application you can:</p>
            <ul>
                <li>Know what to expect to pay when you get a prescription from your doctor</li>
                <li>Find possible generics for a branded medicine. Ask your doctor if these medicines are viable alternatives.</li>
                <li>Ensure that you are not being overcharged for your medicine.</li>
            </ul>
          </div>
        </section>
        <section class="panel panel-info">
          <header class="panel-heading">
            <h3 class="panel-title">How can you use it?</h3>
          </header>
          <div class="panel-body">
            <p>Here are some ideas for how this application can be useful:</p>
            <ul>
                <li>When your doctor prescibes a medicine, quickly check on your phone for alternatives and ask whether the brand name product can be replaced with a generic.</li>
                <li>If you're on chronic medication you can periodically check to see whether the price of your meds has increased.</li>
                <li>While waiting in the queue at the pharmacy, you can look up your medicine and find out how much it will cost you and what alternatives you can ask the pharmacist for.</li>
                <li>If you look up a particular medicine often, you can bookmark the page so that you can quickly refer to it.</li>
            </ul>
          </div>
        </section>
        <section class="panel panel-info">
          <header class="panel-heading">
            <h3 class="panel-title">What is the <abbr title="Single Exit Price">Single Exit Price</abbr>?</h3>
          </header>
          <div class="panel-body">
            <p>The single exit price (SEP) mechanism in South Africa lists the maximum price that a medicine can be charged at. Dispensers may charge an additional dispensing fee depending on the price of the medicine. The Medicines and Related Substances Act allows for the following charges (excl VAT):</p>
            <ul>
                {% for row in price_parameters.prices %}
                    {% if not row.0|isinf %}
                    <li>Where the SEP is less than R{{ row.0|floatformat:2 }}, the maximum dispensing fee is R{{ row.2|floatformat:2 }} + {{ row.1|mult:100 }}% of the SEP.</li>
                    {% else %}
                    <li>Otherwise the maximum dispensing fee is R{{ row.2|floatformat:2 }} + {{ row.1|mult:100}}% of the SEP.</li>
                    {% endif %}
                {% endfor %}
            </ul>
            <p>The prices listed in this database represent the maximum price that you should be paying for your medicines (incl VAT). Note that these prices do not apply to dispensing practitioners who have a separate dispensing fee.</p><p>You can find the latest fees schedule <a href="https://search.opengazettes.org.za/text/34055?page=38">here</a>.</p>
            <p>Please note that allowed dispensing fees may change and this website may not be completely up-to-date. The prices listed above were valid at {{ last_updated }}.</p>
          </div>
        </section>
        <section>
          <p class="text-center"><a href="https://www.openup.org.za"><img src="/static/images/logo.svg" alt="OpenUp"></a></p>
        </section>
      </aside>
      <footer role="contentinfo" class="container text-center">

        <ul class="list-inline">
          <li>These prices were collected on {{ last_updated }}.</li>
          <li>Contact &#097;&#100;&#105;&#064;&#111;&#112;&#101;&#110;&#117;&#112;&#046;&#111;&#114;&#103;&#046;&#122;&#097; for more details</li>
        </ul>
        <ul class="list-inline">
          <li><a href="/">MPR</a> is powered by <a href="https://www.openup.org.za/">OpenUp</a>.</li>
          <li><a href="https://github.com/Code4SA/medicine-price-registry">Pull requests are welcome</a></li>
          <li>Thanks <a href="http://onlinepharmacycheck.com/medico/">MedICO</a> for the cool icons.</li>
        </ul>
      </footer>
    </main>
    {% javascript 'mprbase' %}
    {% block bodybottom %}{% endblock %}
  </body>
</html>
